package com.daxilong.starchen.player.activity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BatteryReceiver extends BroadcastReceiver {

    private final VideoPlayerActivity videoPlayerActivity;

    public BatteryReceiver(VideoPlayerActivity videoPlayerActivity){
        this.videoPlayerActivity = videoPlayerActivity;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        int level = intent.getIntExtra("level",0);//电量：0~100
        videoPlayerActivity.setBattery(level);
    }

}
